package com.book.manager.controller;

import com.book.manager.pojo.Customer;
import com.book.manager.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author wzy
 * @Date 2024/6/2 0:14
 * @description: 顾客管理
 */
@RestController
public class CustomerController {
    @Autowired
    private CustomerService customerService;

    @GetMapping("/api/customer")
    public List<Customer> list(){
        return customerService.list();
    }
    @DeleteMapping("/api/customer/delete/{id}")
    public void deleteById(@PathVariable("id") int id){
        customerService.deleteById(id);
    }
}
